package org.axon.jmsexample.service;

import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.MessageListener;
//import javax.jms.TextMessage;

import org.axon.jmsexample.util.Method;
import org.axon.jmsexample.util.SocialType;

public class OrderReceiver implements MessageListener {

	@Override
	public void onMessage(Message message) {
		if (message instanceof MapMessage) {
			Message mapMessage = (MapMessage) message;
			SocialType socialType = null;
			Method method = null;
			
			try {
				socialType = (SocialType) mapMessage
						.getObjectProperty("socialType");
				method = (Method) mapMessage.getObjectProperty("method");
			} catch (JMSException e) {
				e.printStackTrace();
			}
			
			if(socialType != null && method != null) {
				
			}
		}
	}
}
